package cn.dankal.basiclib.api;

import com.alibaba.fastjson.JSONObject;

import java.util.Map;

import cn.dankal.annotations.ApiFactory;
import cn.dankal.business.pojo.BaseBeanList;
import cn.dankal.business.pojo.BrandResponse;
import cn.dankal.business.pojo.CommentBean;
import cn.dankal.business.pojo.CurrentBean;
import cn.dankal.business.pojo.CurrentSendBean;
import cn.dankal.business.pojo.ReasonBean;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

@ApiFactory(value = FgBaseApi.class)
/**
 * 此刻
 */
public interface CurrentService {
    /**
     * 此刻列表
     *
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @GET("user/info/get/user/info_list")
    Observable<BaseBeanList<CurrentBean>> info_list(
            @Query("pageIndex") String pageIndex,
            @Query("pageSize") String pageSize);

    /**
     * 查看指定用户的此刻列表
     *
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @GET("user/operate/get/user/info_list")
    Observable<BaseBeanList<CurrentBean>> user_info_list(
            @Query("pageIndex") String pageIndex,
            @Query("pageSize") String pageSize);


    @GET("user/info/get/user/info_details/{uuid}")
    Observable<CurrentBean> info_detail(@Path("uuid") String uuid);


    /**
     * 评论列表
     *
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @GET("user/info/get/comment_list")
    Observable<BaseBeanList<CommentBean>> comment_list(
            @Query("infoUuid") String infoUuid,
            @Query("pageIndex") String pageIndex,
            @Query("pageSize") String pageSize);


    /**
     * 品牌列表
     *
     * @return
     */
    @GET("user/info/get/brand_list")
    Observable<JSONObject> brand_list();

    /**
     * 评论 帖子
     *
     * @return
     */
    @PUT("user/info/comment")
    Observable<ReasonBean> comment(@Body Map<String, String> map);

    /**
     * 评论 评论
     *
     * @param map
     * @return
     */
    @PUT("user/info/inside_comment")
    Observable<ReasonBean> inside_comment(@Body Map<String, Object> map);

    /**
     * 点赞
     *
     * @return
     */
    @PUT("user/info/praise_user_info")
    Observable<ReasonBean> praise_user_info(@Query("type") String type,
                                               @Query("uuid") String uuid,@Query("praiseFlag")boolean isPraise);

    /**
     * 删除
     *
     * @return
     */
    @HTTP(method = "DELETE",path = "user/operate/delete/userInfo",hasBody = true)
    Observable<ReasonBean> delete_info(@Query("list") String map);

    /**
     * 车主认证删除
     *
     * @return
     */
    @HTTP(method = "DELETE",path = "user/operate/delete/vehicle",hasBody = true)
    Observable<ReasonBean> delete_verify_info(@Query("list") String map);

    /**
     * 发布此刻
     * @param map
     * @return
     */
    @POST("user/info/release_user_info")
    Observable<CurrentSendBean> release_user_info(@Body Map<String, Object> map);
}
